#!/bin/bash -e

function info() {
echo Usage: `basename $0` '(in.vcf)s|vcf_list_file'
exit 65
}

while getopts ":p:l:mghr:" opts
do
case $opts in
	m) somatic=T;;
    r) ref=$OPTARG;;
	g) single_cell=T;;
	l) interval=$OPTARG;;
	p) out_prefix=$OPTARG;;
	\?) info;;
esac
done
shift $(($OPTIND - 1))

test $# -lt 1 && info


. $var

test -n "$ref" && ref_genome=$ref

if test $# -eq 1; then

	for file in $(cat $1); do
	variants="--variant $file $variants"
	done

else 

	for file; do
	variants="--variant $file $variants"

	done
fi

echo;echo;echo gatk CombineVariants
java $tmp -jar $gatk \
	-R $ref_genome \
	-T CombineVariants \
    -nt 4 \
	-o $out_prefix.combined.vcf \
	-genotypeMergeOptions UNIQUIFY \
    -filteredRecordsMergeType KEEP_IF_ALL_UNFILTERED \
	$variants
	

. $cmd_done